<template>
  <div>
    <slot></slot>
    <ul class="ul">
      <li v-for="(item, index) in list" :key="item.id" class="li">
        <input type="checkbox" v-model="item.status" />
        <p>{{ item.title }}</p>
        <button @click="del(item.id)">删除</button>
      </li>
    </ul>
  </div>
</template>



<script>
import { mapMutations } from "vuex";
export default {
  props: {
    list: Array
  },

  methods: {
    del(id) {
      this.remove(id);
    },
    ...mapMutations(["remove"])
  }
};
</script>

<style lang="scss" scoped>
.ul {
  margin-top: 40px;
  margin-bottom: 40px;
}
.li {
  display: flex;
}
</style>
